The copy( ) Function is used to make a copy of the Dictionary.
x = { 5 : "Is a Number", "John": "Is a Name", "Python": "Is a Language" } y = x.copy() print("The Copied Dictionary is ",y)
Similarly, in the above code we have created a 'Dictionary' and initialised to the variable 'x'.
x = { 5 : "Is a Number", "John": "Is a Name", "Python": "Is a Language" }
Then we have used the 'copy( )' method that Dictionary 'x' invokes and creates a new Dictionary that would be the exact copy of 'x'.
Then assign it to 'y'.
And if we see the below output,
The new variable 'y' is an exact copy of 'x'.